package com.yuelife.admin.dao;

import com.yuelife.admin.pojo.Comment;
import org.apache.ibatis.annotations.Delete;

import java.util.List;

public interface CommentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);
    @Delete("delete from c_comment where discusion=#{did} and status=2")
    int deletyByDiscussionId(Integer did);

//    通过id查询到所有的回复
    List<Comment> selectByDiscussionid(Integer did);
//    查询所有跟帖的回复（帖子下面的回复的回复）
    List<Comment> selectComment(Integer did);
}